import { IRouteComponentProps } from 'umi'
import { Layout } from 'antd'
import MyMenu from '@/components/myMenu'
import MyHeader from '@/components/myHeader'

const whiteLists = ['/login']
export default function GlobalLayout({ children, location, route, history, match }: IRouteComponentProps) {
  // console.log('location...', location)
  if (whiteLists.indexOf(location.pathname) !== -1) {
    return children
  }

  return (
    <>
      <MyMenu />
      <Layout>
        <MyHeader />
        { children }
      </Layout>
    </>
  );
}
